package com.huawei.lynnbit.tool.cocos.config.game.task;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.HashMap;
import java.util.Map;

public enum Stage {
    BEFORE_EXPORT("beforeExport"), EXPORT("export"), ASSEMBLE_APP("assemble_app"), BEFORE_PACKAGE("beforePackage"), PACKAGE("package");

    private static Map<String, Stage> namesMap = new HashMap<>();

    static {
        namesMap.put(BEFORE_EXPORT.name, BEFORE_EXPORT);
        namesMap.put(BEFORE_PACKAGE.name, BEFORE_PACKAGE);
    }

    private final String name;

    Stage(String name) {
        this.name = name;
    }

    @JsonCreator
    public static Stage forName(String name) {
        return namesMap.get(name);
    }

    @JsonValue
    public String toName() {
        return name;
    }

}
